//
//  BVNavigationController.m
//  runLeg1
//
//  Created by YYKJ on 2017/4/5.
//  Copyright © 2017年 YYKJ. All rights reserved.
//

#import "BVNavigationController.h"
#import "UIBarButtonItem+BVItem.h"

@interface BVNavigationController ()

@end

@implementation BVNavigationController

- (void)viewDidLoad {
    [super viewDidLoad];

    //设置标题文字颜色以及字体
    [self.navigationBar setTitleTextAttributes:
     @{NSFontAttributeName:[UIFont systemFontOfSize:16],
       NSForegroundColorAttributeName:COLOR_RGB(254, 255, 254, 1.0)}];
    
    //设置导航栏颜色
    self.navigationBar.barStyle = UIBarStyleDefault;
    self.navigationBar.barTintColor = [UIColor BVNavBackgroundColor];
    self.navigationBar.translucent = NO;
}

- (void)pushViewController:(UIViewController *)viewController animated:(BOOL)animated{
    if(self.childViewControllers.count > 0) {
        
        viewController.hidesBottomBarWhenPushed = YES;
        viewController.navigationItem.leftBarButtonItem = [UIBarButtonItem barButtonItemWithImage:[UIImage imageNamed:@"back_3"] target:self action:@selector(navigationBackClick) forControlEvents:UIControlEventTouchUpInside];
    }
    [super pushViewController:viewController animated:animated];
}

#pragma mark - 返回按钮
- (void)navigationBackClick{
    [self popViewControllerAnimated:YES];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    
}


@end
